package com.example.config.dynamicTask;

import java.util.concurrent.ScheduledFuture;

/**
 * @author ZhengDing
 * @date 2022/3/31 9:57
 */

public final class ScheduledFutureTask {
    
    volatile ScheduledFuture<?> future;
    
    /**
     * 取消定时任务
     */
    public void cancel() {
        ScheduledFuture<?> future = this.future;
        if (future != null) {
            future.cancel(true);
        }
    }
}
